<link rel="stylesheet" type="text/css" href="<{$url}><{$template}>/css/style.css"/>
<script type="text/javascript" src="<{$url}><{$template}>/css/jquery.min.js"></script>
<script type="text/javascript">
function good(mid)
  {
    $.ajax({
	  type:"POST",
	  url:"<{$url}><{spUrl c=guestbook a=AjaxGood}>",
	  data:"mid="+mid,
	  cache:false,
	  success:function(data){
		$("#good"+mid).html(data);
	  }
  });
  $("#good"+mid).html('谢谢您的支持！');
  return false;
  }
</script>

<!--wrapper-->
<div class="SY_wrapper border_radius_5px">
<div class="adminlist">
  <span class="fl">管理员：<{tpl_adminuserList gid=$g.id}></span>
  <span class="fr"><{tpl_MegSum gid=$g.id}></span>
  <div class="clear"></div>
</div>

<div class="b15"></div>

<{if $g.gDisplay eq 'yes'}>

<{$i = 0}>
<{foreach from=$message item=m}>
<{$i = $i+1}>
<div class="megList <{cycle values="bg1,bg2"}>">
  <div class="meg">
    <div class="mTop">
      <span class="fl"><span class="user ico">网友：<{$m.name}></span>&nbsp;&nbsp;&nbsp;<span class="time ico">时间：<{tpl_formatTime date=$m.addtime type=1}></span></span>
      <span class="fr">#<{$i}></span>
      <div class="clear"></div>
    </div>
    <div class="mContent">
      <div><{$m.message}></div>
      <{if $m.reply}>
      <div class="reply">
        <div class="tit">管理员<{$m.replyAdmin}>回复：</div>
        <div class="con"><{$m.reply}></div>
      </div>
      <{/if}>
    </div>
    <div class="mSm">
      <span class="fl"><span class="address ico"><{$m.address}>（<{tpl_hideIp ip=$m.ip}>）</span></span>
      <span class="fr" id="good<{$m.id}>"><a class="good ico" onclick="javascript:good('<{$m.id}>');">赞一下（<{$m.good}>）</a></span>
      <div class="clear"></div>
    </div>
  </div>
  <div class="clear"></div>
</div>
<{/foreach}>

<!--分页-->
<{if $pager}>

<div class="pag">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
      <div class="pager">共有记录<{$pager.total_count}>条</div>
	</td>
  </tr>
</table>
</div>
<div class="b15"></div>
<{/if}>
<!--分页 end-->
<{elseif $g.gDisplay eq 'no'}>
<div class="gDisplayNo">已关闭留言显示！</div>
<div class="b15"></div>
<{/if}>

<a name="MegAddForm" id="MegAddForm"></a>
<div class="megAdd">
  <div class="addform basic-grey">
    <h1>在线留言<span>请认真填写您的留言信息，以便我们能更快的处理您的问题！</span></h1>
    <form id="MyMegForm" name="MyMegForm" method="post" action="<{$url}><{spUrl c=guestbook a=megAddPost gid=$g.id}>">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="45" align="center"><span class="Prompt">昵称</span></td>
          <td>
            <input type="text" name="name" id="name" datatype="*2-30" nullmsg="昵称不能为空！" errormsg="昵称必须为2~30个字符!" value="<{$smarty.cookies.valueName}>" /></td>
        </tr>
        <tr>
          <td align="center"><span class="Prompt">QQ</span></td>
          <td><input type="text" name="qq" id="qq" datatype="n5-12" errormsg="QQ格式错误!" nullmsg="QQ号不能为空！" value="<{$smarty.cookies.valueQq}>" /></td>
        </tr>
        <tr>
          <td align="center"><span class="Prompt">留言<br />内容</span></td>
          <td>
            <textarea name="message" id="message" cols="45" rows="5" datatype="*" nullmsg="留言内容不能为空！"></textarea></td>
        </tr>
        <tr>
          <td align="center">验证</td>
          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="130"><input type="text" name="verifycode" id="verifycode" datatype="n4-4" errormsg="验证码格式错误!" nullmsg="验证码不能为空！" style="width:100px;"  /></td>
              <td><img id="img" class="verifycodeImg" style="width:90px; height:30px; cursor:pointer; margin-bottom:15px;" src="<{$url}>index.php?c=main&a=verifyCode" onclick="document.getElementById('img').src='<{$url}>index.php?c=main&a=verifyCode&amp;tm='+Math.random()"></td>
            </tr>
          </table></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" class="submit" name="submit" id="submit" value="提交留言" />&nbsp;&nbsp;&nbsp;&nbsp;<span id="msgSpan">文明上网，理性发言！</span></td>
        </tr>
      </table>
    </form>
  </div>
  <div class="clear"></div>
</div>

</div><!--wrapper End-->

<div class="SY_footer">
  <span class="fr">Powered by <a href="http://syguestbook.logphp.com" target="_blank">SyGouestBook</a></span>
  <div class="clear"></div>
</div>

<script type="text/javascript" src="<{$url}><{$template}>/css/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
$(function(){		
	$("#MyMegForm").Validform({
		tiptype:function(msg,o,cssctl){
			var objtip=$("#msgSpan");
			cssctl(objtip,o.type);
			objtip.text(msg);
		},
		ajaxPost:false
	});
})
</script>